package com.sxfans.util;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
	public static void main(String[] args) {
//		String mobile = "18710048332";
//		System.out.println(replaceByLen(mobile, "****" ,3, 8));
		//System.out.println(emailVerify("hu.tang@yeepay.com"));
		System.out.println("");
	}
	
	public static String replaceByLen(String data,String repStr,int start,int end)
	{
		String str1 = data.substring(0,start);
		String str2 = data.substring(end-1,data.length());
		return str1+repStr+str2;
	}
	
	public static boolean  emailVerify(String email) {
		if(StringUtils.isBlank(email))
			return false;
		String regex2 = "^([a-zA-Z0-9]|[._])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$";// �����ʽ
		Pattern pattern = Pattern.compile(regex2);
		Matcher matcher = pattern.matcher(email);
		if(!matcher.matches()){
			return false;
		}
		return true;
	}
	
}
